<template>
    <div>
        <div class="root-list">
            <div style="display: flex; margin-bottom: 10px;">
                <div style="padding-top: 4px;"><img src="@/assets/root.png" alt="" width="24px" height="24px"></div>
                <div class="root-title">root-did列表</div>
                <el-button type="primary" plain @click="addRootDidVisible = true">注册root-did</el-button>
            </div>
            <el-dialog title="注册root-did" :visible.sync="addRootDidVisible">
                <el-form :model="rootDidForm">
                    <el-form-item label="rootDid" :label-width="formLabelWidth">
                        <el-input v-model="rootDidForm.rootDid" autocomplete="off"></el-input>
                    </el-form-item>
                    <el-form-item label="pubkey" :label-width="formLabelWidth">
                        <el-input v-model="rootDidForm.pubkey" autocomplete="off"  type="textarea"></el-input>
                    </el-form-item>
                </el-form>
                <div slot="footer" class="dialog-footer">
                    <el-button @click="cancelAddRootDid()">取 消</el-button>
                    <el-button type="primary" @click="addRootDid()">确 定</el-button>
                </div>
            </el-dialog>
            <el-table :data="rootData" v-loading="loading" :border="true" style="width: 40%" :header-cell-style="{background:'#D8E8FF'}">
                <el-table-column type="index" label="序号" width="80" align="center" />
                <el-table-column prop="rootDid" label="rootDid" align="center" />
            </el-table>
        </div>
        <div class="chain-list">
            <div style="display: flex; margin-bottom: 10px;">
                <div style="padding-top: 6px;"><img src="@/assets/chain.png" alt="" width="20px" height="20px"></div>
                <div class="chain-title">业务链DID列表</div>
                <el-button type="primary" plain @click="addChainVisible = true">注册业务链DID</el-button>
            </div>
            <el-dialog title="注册业务链DID" :visible.sync="addChainVisible">
                <el-form :model="chainForm">
                    <el-form-item label="issuerDid" :label-width="formLabelWidth">
                        <el-input v-model="chainForm.issuerDid" autocomplete="off"></el-input>
                    </el-form-item>
                    <el-form-item label="tlsHostName" :label-width="formLabelWidth">
                        <el-input v-model="chainForm.tlsHostName" autocomplete="off"></el-input>
                    </el-form-item>
                    <el-form-item label="nodeAddress" :label-width="formLabelWidth">
                        <el-input v-model="chainForm.nodeAddress" autocomplete="off"></el-input>
                    </el-form-item>
                    <el-form-item label="chainId" :label-width="formLabelWidth">
                        <el-input v-model="chainForm.chainId" autocomplete="off"></el-input>
                    </el-form-item>
                    <el-form-item label="orgId" :label-width="formLabelWidth">
                        <el-input v-model="chainForm.orgId" autocomplete="off"></el-input>
                    </el-form-item>
                    <el-form-item label="rootCaCrt" :label-width="formLabelWidth">
                        <el-input v-model="chainForm.rootCaCrt" autocomplete="off"></el-input>
                    </el-form-item>
                    <el-form-item label="userKey" :label-width="formLabelWidth">
                        <el-input v-model="chainForm.userKey" autocomplete="off"></el-input>
                    </el-form-item>
                    <el-form-item label="userCrt" :label-width="formLabelWidth">
                        <el-input v-model="chainForm.userCrt" autocomplete="off"></el-input>
                    </el-form-item>
                    <el-form-item label="userSignKey" :label-width="formLabelWidth">
                        <el-input v-model="chainForm.userSignKey" autocomplete="off"></el-input>
                    </el-form-item>
                    <el-form-item label="userSignCrt" :label-width="formLabelWidth">
                        <el-input v-model="chainForm.userSignCrt" autocomplete="off"></el-input>
                    </el-form-item>
                </el-form>
                <div slot="footer" class="dialog-footer">
                    <el-button @click="cancelAddChain()">取 消</el-button>
                    <el-button type="primary" @click="addChain()">确 定</el-button>
                </div>
            </el-dialog>
            <el-table :data="tableData" v-loading="loading" :border="true" style="width: 50%" :header-cell-style="{background:'#D8E8FF'}">
                <el-table-column type="index" label="序号" width="80" align="center" />
                <el-table-column prop="ChainDID" label="ChainDID" align="center" />
                <el-table-column prop="info.ChainId" label="ChainId" width="220" align="center" />
            </el-table>
        </div>
        <div class="identity">
            <div style="display: flex; margin-bottom: 10px;">
                <div><img src="@/assets/account-role.png" alt="" width="32px" height="32px"></div>
                <div class="identity-title">显示聚合身份</div>
                <div><el-input placeholder="请输入rootDid" v-model="rootDidParams" clearable style="margin-right: 10px;"/></div>
                <el-button type="primary" plain @click="showBindList()" >查询</el-button>
            </div>
            <el-table :data="bindList" v-loading="loading" :border="true" style="width: 100%" :header-cell-style="{background:'#D8E8FF'}">
                <el-table-column type="index" label="序号" width="80" align="center" />
                <el-table-column prop="rootDid" label="rootDid" />
                <el-table-column prop="ChainDID" label="ChainDid" />
                <el-table-column prop="sign" label="Sign" />
            </el-table>
            <el-row>
                <el-col :span="8">
                    <el-input placeholder="请输入业务链DID_1" v-model="chain1" clearable style="padding: 20px 30px; " />
                    <el-input placeholder="请输入业务链DID_2" v-model="chain2" clearable style="padding: 0px 30px; "/>
                </el-col>
                <el-col :span="4">
                    <div style="padding-top: 50px;"><el-button type="primary" plain @click="affirm()">跨链身份互认</el-button></div>
                </el-col>
                <el-col :span="10">
                    <div v-if="this.affirmFlag == 0" style="padding-top: 45px; font-size: 26px; display: flex; line-height: 40px;">
                        <img src="@/assets/error.png" alt="" width="40px" height="40px">
                        <div style="margin-left: 10px;">失败</div>
                    </div>
                    <div v-if="this.affirmFlag == 1" style="padding-top: 45px; font-size: 26px; display: flex; line-height: 40px;">
                        <img src="@/assets/success.png" alt="" width="40px" height="40px">
                        <div style="margin-left: 10px;">成功</div>
                    </div>
                </el-col>
            </el-row>

        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            addChainVisible: false,
            updateChainVisible: false,
            addRootDidVisible: false,
            signChainVisible: false,
            bindChainVisible: false,
            chainForm: {           
                issuerDid: '',
                tlsHostName: '',
                nodeAddress: '',
                chainId: '',
                orgId: '',
                certificates: {
                    rootCaCrt: '',
                    userKey: '',
                    userCrt: '',
                    userSignKey: '',
                    userSignCrt: '',
                }
            },
            rootDidForm: {           
                rootDid: '',
                pubkey: '',
            },
            signForm: {           
                privateKey: '',
                message: '',
            },
            bindForm: {           
                rootDid: '',
                ChainDID: '',
                sign: '',
            },
            formLabelWidth: '120px',
            tableData: [
                {
                    "ChainDID": "did:ctid:1EuEiRBBtuiWJcPh76CfnVVxvnt9zE1rnp",
                    "info": {
                        "ChainId": "chain_dcwjm",
                        "NodeAddress": "36.110.223.84:9000",
                        "OrgId": "69vkhhkorg.cm-048rqsevp9",
                        "TlsHostName": "consensus1-69vkhhkorg.cm-048rqsevp9"
                    },
                    "sign": []
                },
                {
                    "ChainDID": "did:ctid:25s8K9ZTDfLK25HwXiaNNUTczoeMycfchr",
                    "info": {
                        "ChainId": "chain_dcwjm",
                        "NodeAddress": "36.110.223.84:9000",
                        "OrgId": "69vkhhkorg.cm-048rqsevp9",
                        "TlsHostName": "consensus1-69vkhhkorg.cm-048rqsevp9"
                    },
                    "sign": []
                }
            ],
            updateChainIndex: 0,
            signChainIndex: 0,
            bindChainIndex: 0,
            rootDidParams: '',
            rootData: [
                {
                    "rootDid": "did:ctid:2z3kQEC6AKDwJsVk889RwARbyfuSefFmN8",
                    "pubkey": "",
                    "privateKey": "-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgkRjRlkNlLCWP7uJq\ng/OPtpbKO8cN8MYFKmKiNwr3+ZagCgYIKoEcz1UBgi2hRANCAARdE1bthn4gTOqE\nPh1hyEgG/rrj+aAtqZd7kae7WAwpni8BIhNMbOqbvGQcbCF/rSGE5q7utTGc3tTN\n8pXyH4ik\n-----END PRIVATE KEY-----\n",
                    "bindList": [
                        {
                            "rootDid": "did:ctid:2z3kQEC6AKDwJsVk889RwARbyfuSefFmN8",
                            "ChainDID": "did:ctid:1EuEiRBBtuiWJcPh76CfnVVxvnt9zE1rnp",
                            "sign": "BtIM33yTDQS40vg9uUoryf4ZGNAvfqhAiDRqOGKJgyMGGeVDZoVkZaOiCnoAOfJ5-9ryRHhhtMB1Yy7twVxsCOemE6UrIn0wId8axYvdeQBobB5BCLj6w6YL180qBNlo5",
                        },
                        {
                            "rootDid": "did:ctid:2z3kQEC6AKDwJsVk889RwARbyfuSefFmN8",
                            "ChainDID": "did:ctid:25s8K9ZTDfLK25HwXiaNNUTczoeMycfchr",
                            "sign": "f18iC7pK72LhA0x2u8YnJ9GWmzvDF0e7GAEFRZ53yCYsxZqJpTbpWgEBzkcmJ089-tCR0M9zk07B04VfEvicyLEC7RWyL2fF9AhBemkrP53qBM0g5TVFlGAvRaOSOiIru",
                        },
                    ]
                }
            ],
            bindList: [
                
            ],
            chain1: "",
            chain2: "",
            affirmFlag: -1
        }
    },
    methods: {
        clearChainForm() {
            this.chainForm = {           
                issuerDid: '',
                tlsHostName: '',
                nodeAddress: '',
                chainId: '',
                orgId: '',
                certificates: {
                    rootCaCrt: '',
                    userKey: '',
                    userCrt: '',
                    userSignKey: '',
                    userSignCrt: '',
                }
            }
        },
        clearRootDidForm() {
            this.rootDidForm = {           
                rootDid: '',
                pubkey: '',
            }
        },
        clearSignForm() {
            this.signForm = {           
                privateKey: '',
                message: '',
            }
        },
        clearBindForm() {
            this.bindForm = {           
                rootDid: '',
                ChainDID: '',
                sign: '',
            }
        },
        addChain() {
            var info = {
                "ChainDID": this.chainForm.issuerDid,
                "info": {
                    "ChainId": this.chainForm.chainId,
                    "NodeAddress": this.chainForm.nodeAddress,
                    "OrgId": this.chainForm.orgId,
                    "TlsHostName": this.chainForm.tlsHostName
                },
                "sign": []
            }
            this.tableData.push(info)
            this.addChainVisible = false
            this.$message.success('添加业务链成功');
            this.clearChainForm()
        },
        cancelAddChain() {
            this.addChainVisible = false
            this.clearChainForm()
        },
        deleteChain(index) {
            this.tableData.splice(index, 1)
            this.addChainVisible = false
            this.$message.success('移除业务链成功');
        },
        updateChain() {
            this.tableData[this.updateChainIndex].ChainDID = this.chainForm.issuerDid
            this.tableData[this.updateChainIndex].info.TlsHostName = this.chainForm.tlsHostName
            this.tableData[this.updateChainIndex].info.NodeAddress = this.chainForm.nodeAddress
            this.tableData[this.updateChainIndex].info.ChainId = this.chainForm.chainId
            this.tableData[this.updateChainIndex].info.OrgId = this.chainForm.orgId
            this.updateChainVisible = false
            this.$message.success('更新业务链信息成功');
            this.clearChainForm()
        },
        updateChainShow(index) {
            this.chainForm.issuerDid = this.tableData[index].ChainDID
            this.chainForm.tlsHostName = this.tableData[index].info.TlsHostName
            this.chainForm.nodeAddress = this.tableData[index].info.NodeAddress
            this.chainForm.chainId = this.tableData[index].info.ChainId
            this.chainForm.orgId = this.tableData[index].info.OrgId
            this.chainForm.rootCaCrt = "-----BEGIN CERTIFICATE-----\nMIICcTCCAhegAwIBAgIDAPh6MAoGCCqBHM9VAYN1MGkxCzAJBgNVBAYTAkNOMRAw\nDgYDVQQIEwdCZWlqaW5nMRAwDgYDVQQHEwdCZWlqaW5nMRAwDgYDVQQKEwd3eC1y\nb290MQ0wCwYDVQQLEwRyb290MRUwEwYDVQQDEwxyb290Lnd4LXJvb3QwIBcNMjMw\nNTE5MDMxNzE2WhgPMjEyMzA0MjUwMzE3MTZaMIGGMQ4wDAYDVQQGEwVjaGluYTEO\nMAwGA1UECBMFY2hpbmExDjAMBgNVBAcTBWNoaW5hMSEwHwYDVQQKExg2OXZraGhr\nb3JnLmNtLTA0OHJxc2V2cDkxCzAJBgNVBAsTAmNhMSQwIgYDVQQDExtjYS42OXZr\naGhrb3JnLmNtLTA0OHJxc2V2cDkwWTATBgcqhkjOPQIBBggqgRzPVQGCLQNCAATO\nZgWsGDkUkqkXNFdfKIUwrMfoocehXBF8A3IJLDFzYgJAY2ltScrMUUXMTNGPTydM\n0IhZ0olAmU8Lbs4IpolAo4GNMIGKMA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAG\nBgRVHSUAMA8GA1UdEwEB/wQFMAMBAf8wKQYDVR0OBCIEIFFvqGprwNf4al9CgOFT\nU6EW+SfNfmkdRfN2y4op7qIfMCsGA1UdIwQkMCKAIO4KLUzkcvD2jHU35Z5zurHU\nkYBz2d6S8yPw7wKvmFVlMAoGCCqBHM9VAYN1A0gAMEUCIQDQNtD8oNgJwz+0qgiL\nY5fQhQDd0Ld8kPHnb6zF8u19WwIgG6OuM27aeetO/vlLK0Tjg+0DyN4VAJnVyYqb\ntd4Vh4E=\n-----END CERTIFICATE-----\n"
            this.chainForm.userKey = "-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQguV4zEu+xnBpxRSy6\nNt29yYTOYPIMNdAyssuR4WtVIGGgCgYIKoEcz1UBgi2hRANCAAQGRnq3stju5w0W\nWYhdv8zlXLy0A+WbQeXyBw9FjdHU+1uVDHzP/52JjzeToafGAyI4Phck1fYDihYL\nq+yxV4cf\n-----END PRIVATE KEY-----\n"
            this.chainForm.userCrt = "-----BEGIN CERTIFICATE-----\nMIICgTCCAiegAwIBAgIDCpkhMAoGCCqBHM9VAYN1MIGGMQ4wDAYDVQQGEwVjaGlu\nYTEOMAwGA1UECBMFY2hpbmExDjAMBgNVBAcTBWNoaW5hMSEwHwYDVQQKExg2OXZr\naGhrb3JnLmNtLTA0OHJxc2V2cDkxCzAJBgNVBAsTAmNhMSQwIgYDVQQDExtjYS42\nOXZraGhrb3JnLmNtLTA0OHJxc2V2cDkwHhcNMjMwNTE5MDMxNzQwWhcNMjgwNTE3\nMDMxNzQwWjCBjTEOMAwGA1UEBhMFY2hpbmExDjAMBgNVBAgTBWNoaW5hMQ4wDAYD\nVQQHEwVjaGluYTEhMB8GA1UEChMYNjl2a2hoa29yZy5jbS0wNDhycXNldnA5MQ4w\nDAYDVQQLEwVhZG1pbjEoMCYGA1UEAxMfeWd6Yzg2LjY5dmtoaGtvcmcuY20tMDQ4\ncnFzZXZwOTBZMBMGByqGSM49AgEGCCqBHM9VAYItA0IABAZGerey2O7nDRZZiF2/\nzOVcvLQD5ZtB5fIHD0WN0dT7W5UMfM//nYmPN5Ohp8YDIjg+FyTV9gOKFgur7LFX\nhx+jezB5MA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAGBgRVHSUAMCkGA1UdDgQi\nBCDo5yyoriEgejHtkdYC21vJDa/2wY5skyKGKkWvzqOvQTArBgNVHSMEJDAigCBR\nb6hqa8DX+GpfQoDhU1OhFvknzX5pHUXzdsuKKe6iHzAKBggqgRzPVQGDdQNIADBF\nAiEAvHQ6mNEC4P6OhsrZsDX4BHZhPO8jEvD3akCpHkh0o8UCIDFkfWQr6akf+/kn\nkxo/XDE8nq0w/F140UFPN8QENxpT\n-----END CERTIFICATE-----\n"
            this.chainForm.userSignKey = "-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQggC0LQaHUkVOUko3f\npP7mw2IUFbgUYZIIHsozn7pQcpygCgYIKoEcz1UBgi2hRANCAASwyLtWVuQImLPU\n48dNjpGBYg7jzBuhXGPyAuthHHObUYRQ+OWVX8ClR6uFTkfGSS3nCaWXCcut+Nf5\n1Bo/tya+\n-----END PRIVATE KEY-----\n"
            this.chainForm.userSignCrt = "-----BEGIN CERTIFICATE-----\nMIICgjCCAiegAwIBAgIDDjnvMAoGCCqBHM9VAYN1MIGGMQ4wDAYDVQQGEwVjaGlu\nYTEOMAwGA1UECBMFY2hpbmExDjAMBgNVBAcTBWNoaW5hMSEwHwYDVQQKExg2OXZr\naGhrb3JnLmNtLTA0OHJxc2V2cDkxCzAJBgNVBAsTAmNhMSQwIgYDVQQDExtjYS42\nOXZraGhrb3JnLmNtLTA0OHJxc2V2cDkwHhcNMjMwNTE5MDMxNzQwWhcNMjgwNTE3\nMDMxNzQwWjCBjTEOMAwGA1UEBhMFY2hpbmExDjAMBgNVBAgTBWNoaW5hMQ4wDAYD\nVQQHEwVjaGluYTEhMB8GA1UEChMYNjl2a2hoa29yZy5jbS0wNDhycXNldnA5MQ4w\nDAYDVQQLEwVhZG1pbjEoMCYGA1UEAxMfeWd6Yzg2LjY5dmtoaGtvcmcuY20tMDQ4\ncnFzZXZwOTBZMBMGByqGSM49AgEGCCqBHM9VAYItA0IABLDIu1ZW5AiYs9Tjx02O\nkYFiDuPMG6FcY/IC62Ecc5tRhFD45ZVfwKVHq4VOR8ZJLecJpZcJy6341/nUGj+3\nJr6jezB5MA4GA1UdDwEB/wQEAwIBpjAPBgNVHSUECDAGBgRVHSUAMCkGA1UdDgQi\nBCAjsTHWx4l+yWlxlUf0K+l6Va6l7opteymLN1Qjj+L5VzArBgNVHSMEJDAigCBR\nb6hqa8DX+GpfQoDhU1OhFvknzX5pHUXzdsuKKe6iHzAKBggqgRzPVQGDdQNJADBG\nAiEAoW5iOSR7p+2L4FTc7x4rMiqvMWH4hCeyLgu9nv9IFtkCIQDleChubAvhovNX\nhpgZp3En8CV5t+MeEEm60o0i2bjGUQ==\n-----END CERTIFICATE-----\n"
            this.updateChainVisible = true
            this.updateChainIndex = index
        },
        addRootDid() {
            const characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
            const signLength = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgkRjRlkNlLCWP7uJq".length
            let randomSign = ''
            for (let i = 0; i < signLength; i++) {
                const randomIndex = Math.floor(Math.random() * characters.length)
                randomSign += characters.charAt(randomIndex)
            }
            var info = {
                "rootDid": this.rootDidForm.rootDid,
                "pubkey": this.rootDidForm.pubkey,
                "privateKey": "-----BEGIN PRIVATE KEY-----\n"+randomSign+"\ng/OPtpbKO8cN8MYFKmKiNwr3+ZagCgYIKoEcz1UBgi2hRANCAARdE1bthn4gTOqE\nPh1hyEgG/rrj+aAtqZd7kae7WAwpni8BIhNMbOqbvGQcbCF/rSGE5q7utTGc3tTN\n8pXyH4ik\n-----END PRIVATE KEY-----\n",
                "bindList": []
            }
            this.rootData.push(info)
            this.addRootDidVisible = false
            this.clearRootDidForm()
            console.log(this.rootData)
        },
        cancelAddRootDid() {
            this.addRootDidVisible = false
            this.clearRootDidForm()
        },
        signChainShow(index) {
            this.signChainVisible = true
            this.signChainIndex = index
            this.signForm.message = this.tableData[this.signChainIndex].ChainDID
        },
        signChain() {
            this.signChainVisible = false
            const characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
            const signLength = 100
            let randomSign = ''
            for (let i = 0; i < signLength; i++) {
                const randomIndex = Math.floor(Math.random() * characters.length)
                randomSign += characters.charAt(randomIndex)
            }
            var info = {
                "privateKey": this.signForm.privateKey,
                "sign": randomSign,
            }
            this.tableData[this.signChainIndex].sign.push(info)
            console.log(this.tableData)
            this.$message.success('签名成功');
            this.clearSignForm()
        },
        cancelSignChain() {
            this.signChainVisible = false
            this.clearSignForm()
        },
        bindChainShow(index) {
            this.bindForm.ChainDID = this.tableData[index].ChainDID
            this.bindChainVisible = true
            this.bindChainIndex = index
        },
        cancelBindChain() {
            this.bindChainVisible = false
            this.clearBindForm()
        },
        bindChain() {
            let flag = false
            this.bindChainVisible = false
            var info = {
                "rootDid": this.bindForm.rootDid,
                "ChainDID": this.bindForm.ChainDID,
                "sign": this.bindForm.sign,
            }
            for(let i = 0; i < this.rootData.length; i++) {
                console.log(this.bindForm.rootDid)
                console.log(this.rootData[i].rootDid)

                if (this.bindForm.rootDid == this.rootData[i].rootDid) {
                    console.log(222)
                    let j = 0
                    for(; j < this.tableData[this.bindChainIndex].sign.length; j++) {
                        if (this.tableData[this.bindChainIndex].sign[j].sign == this.bindForm.sign) {
                            console.log(333)
                            break
                        }
                    }
                    console.log(j)
                    if (j < this.tableData[this.bindChainIndex].sign.length) {
                        console.log(this.tableData[this.bindChainIndex].sign[j])
                        console.log(this.rootData[i])
                        console.log(this.tableData[this.bindChainIndex].sign[j].privateKey == this.rootData[i].privateKey)
                        if (this.tableData[this.bindChainIndex].sign[j].privateKey == this.rootData[i].privateKey) {
                            console.log(11111)
                            this.rootData[i].bindList.push(info)
                            this.$message.success('绑定成功');
                            flag = true
                            break
                        }
                        console.log(flag)
                    }
                }
            }
            if (flag == false) {
                this.$message.success('绑定失败，请检查');
            }
            console.log(this.rootData)
            this.clearBindForm()
        },
        showBindList() {
            let i = 0
            for(; i < this.rootData.length; i++) {
                if (this.rootDidParams == this.rootData[i].rootDid) {
                    this.bindList = this.rootData[i].bindList
                    break
                }
            }
            if (i == this.rootData.length) {
                this.bindList = []
            }
        },
        affirm() {
            let i =0
            for(; i < this.bindList.length; i++) {
                if (this.chain1 == this.bindList[i].ChainDID) {
                    break
                }
            }
            if (i == this.bindList.length) {
                this.affirmFlag = 0
            } else {
                for(i = 0; i < this.bindList.length; i++) {
                    if (this.chain2 == this.bindList[i].ChainDID) {
                        break
                    }
                }
                if (i == this.bindList.length) {
                    this.affirmFlag = 0
                } else {
                    this.affirmFlag = 1
                }
            }
        }

    }
}
</script>

<style lang="less" scoped>
.chain-list {
    padding: 0px 40px 30px 40px;
    .chain-title {
        font-size: 16px;
        font-weight: 600;
        line-height: 32px;
        margin: 0 10px;
    }
}
.root-list {
    padding: 20px 40px 30px 40px;
    .root-title {
        font-size: 16px;
        font-weight: 600;
        line-height: 32px;
        margin: 0 10px;
    }
}
.identity {
    padding: 0px 40px 20px 40px;
    .identity-title {
        font-size: 16px;
        font-weight: 600;
        line-height: 32px;
        margin: 0 10px;
        height: 32px;
    }
}
.el-button{
  border-radius: 16px;
  font-size: 12px;
  padding: 9px 15px;
  &.el-button--primary.is-plain{
    color: #409EFF;
    background: #E9F2FF;
    border: 1px solid #C4E1FF;
  }
  &.el-button--danger.is-plain{
    color: #FF9D9D;
    background: #FDEEEE;
    border: 1px solid #FFD4D4;
  }
}
//表格内容颜色
::v-deep .el-table__body tbody tr:nth-child(odd) {
  background-color: #FFFFFF;
}
::v-deep .el-table__body tbody tr:nth-child(even) td {
  background-color: #F1F8FF;
}
//表头文字样式
::v-deep .el-table__header-wrapper {
  thead {
    th{
      div{
        font-weight: 500;
        font-size: 14px;
        color: #333333
      }
    }
  }
}
::v-deep {
    .el-input--suffix .el-input__inner {
        height: 32px;
        width: 400px;
    }
}

</style>